package com.cs.study.homework._0205;

import java.util.Scanner;

public class Table {
    public static void main(String[] args) {
        System.out.println("请输入一个正整数n：");
        Scanner sc = new Scanner(System.in);
        //输入数字n，并打印对应的nn乘法表
        int n = sc.nextInt();
        printTable(n);
    }

    //打印nn乘法表
    public static void printTable(int n) {
        System.out.println("对应的nn乘法表为：");
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(i + "*" + j + "=" + i*j +" ");
            }
            System.out.println();
        }
    }
}
